import { Role } from '@/constants/role'
import { RouterName } from '../name'
import { mergeMeta } from '../merge-meta'

export const errorRoutes = mergeMeta(
  [
    {
      path: 'error',
      name: RouterName.Error,
      meta: { hideChildrenInMenu: true },
      children: [
        {
          path: '404',
          name: RouterName.NotFound,
          component: () => import('@/pages/ErrorPage/NotFound.vue')
        },
        {
          path: '403',
          name: RouterName.Forbidden,
          component: () => import('@/pages/ErrorPage/AuthForbidden.vue')
        }
      ]
    },
    {
      path: '/:pathMatch(.*)*',
      redirect: { name: RouterName.NotFound }
    }
  ],
  {
    role: Role.All,
    requireAuth: false
  }
)
